SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE VIEW dbo.vwtCargosGenericos
AS
SELECT     dbo.tb_CargosGenericos.idCargoGenerico AS ID, dbo.tb_CargosGenericos.Descripcion, dbo.tb_CargosGenericos.OrdenAscenso, 
                      dbo.vwrEscalafones.Descripcion AS Escalafon, dbo.vwrRegimenSalarial.Descripcion AS RegimenSalarial, dbo.tb_CargosGenericos.Mnemo, 
                      dbo.vwrNivelesEnsenanza.Descripcion AS NivelDeEnsenanza
FROM         dbo.tb_CargosGenericos INNER JOIN
                      dbo.vwrNivelesEnsenanza ON dbo.tb_CargosGenericos.Nivel = dbo.vwrNivelesEnsenanza.ID LEFT OUTER JOIN
                      dbo.vwrRegimenSalarial ON dbo.tb_CargosGenericos.RegimenSalarial = dbo.vwrRegimenSalarial.ID LEFT OUTER JOIN
                      dbo.vwrEscalafones ON dbo.tb_CargosGenericos.Escalafon = dbo.vwrEscalafones.ID

GO
GRANT SELECT ON  [dbo].[vwtCargosGenericos] TO [Juntas]
GRANT SELECT ON  [dbo].[vwtCargosGenericos] TO [RegistroTitulos]
GRANT SELECT ON  [dbo].[vwtCargosGenericos] TO [SoloVer]
GO
